import Instance from "@/utils/http.ts";

const BASE_URL = `/location/`

// 获取所有location
export function getLocationListAPI(current:number,pageSize:number){
    return Instance({
        url:BASE_URL+`all`,
        method:'GET',
        params:{
            current,
            pageSize,
        }
    })
}

// 新增一条location
export function addLocationAPI(data:{}){
    return Instance({
        url:BASE_URL+`saveOne`,
        method:'POST',
        data,
    })
}

// 删除一条location
export function deleteLocationAPI(id:number){
    return Instance({
        url:BASE_URL+`${id}`,
        method:'DELETE',
    })
}

// 修改一条location
export function updateLocationAPI(data:{}){
    return Instance({
        url:BASE_URL+`modifyOne`,
        method:'PUT',
        data:data
    })
}
// 获取一条location
export function getOneLocationAPI(id:number){
    return Instance({
        url:"/location/"+`${id}`,
        method:'GET',
    })
}




















